home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #1
/
Amiga Plus 1998 #1.iso
/
demo-versionen
/
haage&partner
/
warpup-warpos
/
source
/
tools
/
showinfo.p
< prev
next >
Wrap
Text File
|
1997-09-24
|
6KB
|
166 lines
incdir include:
incdir lvo:
** '(C) Copyright 1997 Haage & Partner Computer GmbH'
** All Rights Reserved
include powerpc/ppcmacros.i
include powerpc/powerpc.i
include powerpc_lib.i
include exec_lib.i
include dos_lib.i
STRUCTURE POWERINFO,0
APTR POWERINFO_CPU
ULONG POWERINFO_PVR
ULONG POWERINFO_CPUCLOCK_U
ULONG POWERINFO_CPUCLOCK_L
ULONG POWERINFO_BUSCLOCK_U
ULONG POWERINFO_BUSCLOCK_L
APTR POWERINFO_ICACHE
APTR POWERINFO_DCACHE
APTR POWERINFO_TABLE
ULONG POWERINFO_TABLESIZE
ULONG POWERINFO_TBU
ULONG POWERINFO_TBL
LABEL POWERINFO_SIZE
xref _SysBase
xref _DOSBase
xref _PowerPCBase
xref _LinkerDB
smalldata
executable
escapestr
vea
version 10
start
prolog 1024
pushgpr r29-r31
lnk r29,-POWERINFO_SIZE
subi r29,r29,POWERINFO_SIZE
la r4,PPCInfo_Tags
CALLPOWERPC GetInfo
lw r6,Tag_PVR
stw r6,POWERINFO_PVR(r29)
lw r6,Tag_CPU
la r3,CPU_603
bittst r6,CPUP_603
bne .found
la r3,CPU_604
bittst r6,CPUP_604
bne .found
la r3,CPU_603E
bittst r6,CPUP_603E
bne .found
la r3,CPU_604E
bittst r6,CPUP_604E
bne .found
la r3,CPU_620
bittst r6,CPUP_620
bne .found
la r3,CPU_Unknown
.found
stw r3,POWERINFO_CPU(r29)
lw r6,Tag_BUSCLOCK
liw r4,1000000
divwu r3,r6,r4
stw r3,POWERINFO_BUSCLOCK_U(r29)
mullw r3,r3,r4
subf r3,r3,r6
stw r3,POWERINFO_BUSCLOCK_L(r29)
lw r6,Tag_CPUCLOCK
liw r4,1000000
divwu r3,r6,r4
stw r3,POWERINFO_CPUCLOCK_U(r29)
mullw r3,r3,r4
subf r3,r3,r6
stw r3,POWERINFO_CPUCLOCK_L(r29)
lw r6,Tag_ICACHE
la r3,CACHE_OFF_L
bittst r6,CACHEP_OFF_LOCKED
bne .icachedone
la r3,CACHE_OFF_U
bittst r6,CACHEP_OFF_UNLOCKED
bne .icachedone
la r3,CACHE_ON_L
bittst r6,CACHEP_ON_LOCKED
bne .icachedone
la r3,CACHE_ON_U
.icachedone
stw r3,POWERINFO_ICACHE(r29)
lw r6,Tag_DCACHE
la r3,CACHE_OFF_L
bittst r6,CACHEP_OFF_LOCKED
bne .dcachedone
la r3,CACHE_OFF_U
bittst r6,CACHEP_OFF_UNLOCKED
bne .dcachedone
la r3,CACHE_ON_L
bittst r6,CACHEP_ON_LOCKED
bne .dcachedone
la r3,CACHE_ON_U
.dcachedone
stw r3,POWERINFO_DCACHE(r29)
lw r6,Tag_PAGETABLE
stw r6,POWERINFO_TABLE(r29)
lw r6,Tag_TABLESIZE
stw r6,POWERINFO_TABLESIZE(r29)
mftbu r6
mftbl r3
stw r6,POWERINFO_TBU(r29)
stw r3,POWERINFO_TBL(r29)
la _d1,infotext
mr _d2,r29
RUN68K_XL _DOSBase,VPrintf
addi r29,r29,POWERINFO_SIZE
ulnk r29,-POWERINFO_SIZE
popgpr
epilog
section data
infotext dc.b "CPU: %s (PVR = %08lx)\n"
dc.b "CPU clock: %ld.%06ld MHz\n"
dc.b "Bus clock: %ld.%06ld MHz\n"
dc.b "Instruction Cache: %s\n"
dc.b "Data Cache: %s\n"
dc.b "Page table location: %08lx\n"
dc.b "Page table size: %ld KBytes\n"
dc.b "Time base content: %08lx %08lx\n"
dc.b 0
CPU_603 dc.b "PPC 603",0
CPU_603E dc.b "PPC 603E",0
CPU_604 dc.b "PPC 604",0
CPU_604E dc.b "PPC 604E",0
CPU_620 dc.b "PPC 620",0
CPU_Unknown dc.b "UNKNOWN",0
CACHE_ON_U dc.b "ON and UNLOCKED",0
CACHE_OFF_U dc.b "OFF and UNLOCKED",0
CACHE_ON_L dc.b "ON and LOCKED",0
CACHE_OFF_L dc.b "OFF and LOCKED",0
cnop 0,4
PPCInfo_Tags
dc.l PPCINFO_CPU
Tag_CPU dc.l 0
dc.l PPCINFO_PVR
Tag_PVR dc.l 0
dc.l PPCINFO_ICACHE
Tag_ICACHE dc.l 0
dc.l PPCINFO_DCACHE
Tag_DCACHE dc.l 0
dc.l PPCINFO_PAGETABLE
Tag_PAGETABLE dc.l 0
dc.l PPCINFO_TABLESIZE
Tag_TABLESIZE dc.l 0
dc.l PPCINFO_BUSCLOCK
Tag_BUSCLOCK dc.l 0
dc.l PPCINFO_CPUCLOCK
Tag_CPUCLOCK dc.l 0
dc.l 0